home *** CD-ROM | disk | FTP | other *** search
- Path: colossus.holonet.net!russell
- From: russell@news.mdli.com (Russell Blackadar)
- Newsgroups: comp.lang.c++
- Subject: Re: beginner question - typecasting
- Date: 4 Jan 1996 20:40:33 GMT
- Organization: HoloNet National Internet Access System: 510-704-1058/modem
- Message-ID: <4che01$kjm@colossus.holonet.net>
- References: <4cei1r$s02@sun.cis.smu.edu> <30EBCED7.774@sto.fdata.se>
- NNTP-Posting-Host: jubal.mdli.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Niklas Mellin (niklas.mellin@sto.fdata.se) wrote:
- : Damon Bowman wrote:
- : >
- : > When you are typecasting, is there any difference between:
- : >
- : > a = int(x)
- : > and
- : > a = (int) x
-
- : [...]
-
- [...]
-
- : The 2nd form is an inheritance from plain C, and doesn't work
- : when x is of class type...
-
- Ahem, this is wrong. Both forms are valid in C++, and both
- invoke the class's operator int. There is absolutely no
- functional difference between the two forms. It would be
- nice to have just one syntax to convert types, but since C
- supports both, C++ must also. Take a look at the ARM, please.
- --
- Russell Blackadar, russell@mdli.com
-